import React, { useEffect, useState } from 'react';
import { Menu, Button } from 'antd';
import {
  HomeOutlined,
  MailOutlined,
  LineChartOutlined,
  SolutionOutlined,
} from '@ant-design/icons';
import { history, Link } from 'umi';
const { SubMenu } = Menu;

export default function StudentMenu() {
  return (
    <>
      <Menu
        mode="inline"
        defaultSelectedKeys={[history.location.pathname]}
        defaultOpenKeys={[
          history.location.pathname.slice(
            0,
            history.location.pathname.indexOf('/', 10),
          ),
        ]}
      >
        <Menu.Item key="/student/info/team" icon={<HomeOutlined />}>
          <Link to="/student/info/team">个人信息管理</Link>
        </Menu.Item>
        <Menu.Item key="/course" icon={<HomeOutlined />}>
          <Link to="/course">项目课程表</Link>
        </Menu.Item>
        <SubMenu key="/student/work" icon={<HomeOutlined />} title="作业管理">
          <Menu.Item key="/student/work/submit">
            <Link to="/student/work/submit">待提交</Link>
          </Menu.Item>
          <Menu.Item key="/student/work/approving">
            <Link to="/student/work/approving">待批复</Link>
          </Menu.Item>
          <Menu.Item key="/student/work/approved">
            <Link to="/student/work/approved">已批复</Link>
          </Menu.Item>
        </SubMenu>
        <SubMenu
          key="/student/attendance"
          icon={<HomeOutlined />}
          title="考勤记录"
        >
          <Menu.Item key="/student/attendance/project">
            <Link to="/student/attendance/project">项目考勤记录</Link>
          </Menu.Item>
          <Menu.Item key="/student/attendance/clock">
            <Link to="/student/attendance/clock">打卡记录</Link>
          </Menu.Item>
        </SubMenu>
        <Menu.Item key="/leave" icon={<SolutionOutlined />}>
          <Link to="/leave">请假管理</Link>
        </Menu.Item>
        <Menu.Item key="/global/changePassword" icon={<SolutionOutlined />}>
          <Link to="/global/changePassword">修改密码</Link>
        </Menu.Item>
      </Menu>
    </>
  );
}
